<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<script text="text.javascript">
//1.将A5F3转成2进制
    var num='A5F3'
    var num1=parseInt(num,16)
    var num2=num1.toString(2)
    console.log(num2);
    ;
// 2.99乘法表
    for (let i = 1; i <=9 ; i++) {
        for (let j = 1; j <=i ; j++) {
            document.write(j+'*'+i+'='+i*j+' ');
        }
        document.write('<br>');
    }
// 3.输入年月，（用数组）
//       3.1.计算当月有多少天
    var date = prompt('请输入年月')
    var arr =date.split('-')
    var year=arr[0]
    var month=arr[1]
    var day=arr[2]
    // var year=prompt('请输入年分')
    // var month=prompt('请输入月份')
    if (year%4==0 && year%100!=0 ||year%400==0) {
        if (month==1 ||month==3 ||month==5||month==7||month==8||month==10||month==12) {
            document.write('当前月有31天')
        }else if (month==4||month==6 ||month==9||month==11) {
            document.write('当前月有30天')
        }else if (month==2) {
            document.write('当前月有29天')
        }
    }else{
        if (month==1 ||month==3 ||month==5||month==7||month==8||month==10||month==12) {
            document.write('当前月有31天')
        }else if (month==4||month==6 ||month==9||month==11) {
            document.write('当前月有30天')
        }else if (month==2) {
            document.write('当前月有28天')
        }
    }
    document.write('<br>')
//       3.2.计算还剩多少天
    // var day=prompt('请输入号数')
    if (year%4==0 && year%100!=0 ||year%400==0) {
        if (month==1 ||month==3 ||month==5||month==7||month==8||month==10||month==12) {
            document.write('当前月还剩'+(31-day)+'天')
        }else if (month==4||month==6 ||month==9||month==11) {
            document.write('当前月还剩'+(30-day)+'天')
        }else if (month==2) {
            document.write('当前月还剩'+(29-day)+'天')
        }
    }else{
        if (month==1 ||month==3 ||month==5||month==7||month==8||month==10||month==12) {
            document.write('当前月还剩'+(31-day)+'天')
        }else if (month==4||month==6 ||month==9||month==11) {
            document.write('当前月还剩'+(30-day)+'天')
        }else if (month==2) {
            document.write('当前月还剩'+(28-day)+'天')
        }
    }
</script>
<body>
    
</body>
</html>